import request from 'src/utils/request' // 添加拦截器

/**
 * 前端接口
 * @param {*} url：（形参）对应的是test.vue组件内传递的实参
 * 该函数可发送多个get请求
 */
// 公司信息list
export function getCompanyList(query) {
  return request({
    url: '/organizer/companys/list/',
    method: 'get',
    params: query
  })
}
// 获取一条公司的数据
export function getCompanySingleList(id) {
  return request({
    url: `/organizer/companys/${id}/`,
    method: 'get'
  })
}

export function addpentCompany(data) {
  return request({
    url: '/organizer/companys/',
    method: 'post',
    data
  })
}

export function updataCompany(id, data) {
  return request({
    url: `/organizer/companys/${id}/`,
    method: 'put',
    data
  })
}

export function deleteCompany(id) {
  return request({
    url: `/organizer/companys/${id}/`,
    method: 'delete'
  })
}

// 关联资产装置
export function relevanceAssic(data) {
  return request({
    url: `/organizer/companys/equipment/`,
    method: 'put',
    data
  })
}


// 关联监测点位
export function relevancePoint(data) {
  return request({
    url: `/organizer/companys/point/`,
    method: 'put',
    data
  })
}

// 关联设备
export function relevanceDevice(data) {
  return request({
    url: `/organizer/companys/device/`,
    method: 'put',
    data
  })
}

